/* 封装获取供应商数据的相关接口 */
import request from "@/utils/request";
import { CreateSupplierResult, SupplierResponse,CreateSupplierParams, UpdateSupplierParams, UpdateSupplierResult, DeleteSupplierResult, DeleteSupplierParams } from "./types/supplier";

/* 查询供应商数据 */
export async function getSupplierListAPI ():Promise<SupplierResponse>{
  return await request.get<SupplierResponse,SupplierResponse>("/shop/supply")
} 
/* 新增供应商 */
export async function addSupplierDataAPI(params:CreateSupplierParams):Promise<CreateSupplierResult>{
  return await request.post<CreateSupplierResult,CreateSupplierResult>("/shop/supply",params)
}
/* 修改供应商 */
export async function updateSupplierDataAPI(params:UpdateSupplierParams):Promise<UpdateSupplierResult>{
  return await request.put<UpdateSupplierResult,UpdateSupplierResult>("/shop/supply",params)

}
/* 删除供应商 */
export async function deleteSupplierDataAPI(params:DeleteSupplierParams):Promise<DeleteSupplierResult>{
  return await request.delete<DeleteSupplierResult,DeleteSupplierResult>("/shop/supply",{ data: params })
}